﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gqq.Csharpindepth.Designpatter.Moduals;

namespace Gqq.Csharpindepth.Designpatter
{
    public class PatternTest
    {
        public static void Test()
        {
            //Animal dongwu = new AnimalFactory().CreateAnimal("dog");
            //if (dongwu != null)
            //    dongwu.Call();
            //dongwu = new AnimalFactory().CreateAnimal("cat");
            //if (dongwu != null)
            //    dongwu.Call();
            //dongwu = new AnimalFactory().CreateAnimal("Elephant");
            //if (dongwu != null)
            //    dongwu.Call();


//            Singleton s = Singleton.CreateInstance();
//            s.Value = 5;
//            Singleton ss = Singleton.CreateInstance();
//            Console.WriteLine(ss.Value);
//
//            Singleton2 s2 = Singleton2.Instance;
//            s2.Value = 7;
//            Singleton2 s2S = Singleton2.Instance;
//            Console.WriteLine(s2S.Value);
//
//            Singleton3 s3 = Singleton3.Instance;
//            s3.Value = 9;
//            Singleton3 s3S = Singleton3.Instance;
//            Console.WriteLine(s3S.Value);

//            BuildHotelDirector.BuildPatternTest();
// C# indepth 检测完毕
        }
    }
}
